/**
 * @param {number[]} nums
 * @return {number}
 */
var removeDuplicates = function(nums) {

    let slow = 0
    let slowNum = nums[0]

    for (let index = 1; index < nums.length; index++) {
        if(nums[index]==slowNum){
            continue
        }else{
            slow++
            slowNum = nums[slow] = nums[index]
        }

        
    }
    return slow+1
};